<!--弹框组件-->
<template>
    <div v-if="showPop" class="PopconfirmFlex" :style="{ 'z-index': zIndex }">
        <div class="PopconfirmLayout" :style="{ width: w }">
            <div class="Popconfirm_header">
                <span></span>
                <span>{{ title }}</span>
            </div>
            <slot />
        </div>
    </div>
</template>
<script lang="ts" setup>
// 在同一文件中的接口或类型字面量的引用
interface Props {
    /** 弹框宽度，尽量用响应式单位 */
    w?: string;
    /* 标题 */
    title: string;
    /* 显示层级 */
    zIndex?: number;
    /** 显示弹框 */
    showPop: boolean;
}
const props = withDefaults(defineProps<Props>(), {
    w: '15%',
    title: '',
    zIndex: 1,
    showPop: false
});
</script>
<style lang="scss" scoped>
.PopconfirmFlex {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 400px;
    width: 100vw;
    height: auto;
}
.PopconfirmLayout {
    width: 46%;
    background: rgba(7, 0, 0, .9);
    border: 3px solid rgba(226, 67, 36, .9);
}

.Popconfirm_header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: url('@img/RedPopconfirmhead.png') no-repeat;
    background-size: 100% 100%;
    height: 50px;
    line-height: 50px;
    font-size: 18px;
    letter-spacing: 2px;
    span {
        &:last-of-type {
            @include fontCustomStyle(#E24324, 18px);
        }
    }
}
</style>
